﻿@model thailandProject.Models.PROPERTY

@{
    ViewBag.Title = "ViewProperty";
}

<div id="Wrapper2">
    <div id="content_header">
        <div id="headerimage">
        </div>
        <div id="theheader">@ViewBag.Header</div>
    </div>
    
    <aside id="sidebar-wrapper">
        <nav class="sidebar">

    <div class="propertyGetInfo">

    <div id="viewPropertyName">
        <div class="displayLabelProp">Property:</div>
        <div class="display-field">
            @Html.DisplayFor(model => model.propName)
        </div>
    </div>
    <div id = "viewPropertyDetails">
        <div class="displayLabelProp">Details:</div>
        <div class="display-field">
            @Html.DisplayFor(model => model.propDetails)
        </div>
    </div>
    <div id="viewPropertyURL">
        <div class="displayLabelProp">URL:</div>
        <div class="display-field">
            @{
                //The hyperlink may or may not contain a http://
                //If it does not, then it will not redirect to an external site
                string hyperlink = Model.propHyperlink;
                if(hyperlink != null && !hyperlink.ToLowerInvariant().Contains("http://"))
                {
                    hyperlink = "http://" + hyperlink;
                }
            }
            <a href="@hyperlink">@Model.propHyperlink</a>
        </div>
    </div>
    <div id="viewPropertyLocation">
        <div class="displayLabelProp">Location:</div>
        <div class="display-field">
            @Html.DisplayFor(model => model.propLocation)
        </div>
    </div>
    <div id="viewPropertyActive">
        <div class="displayLabelProp">Active:</div>
        <div class="display-field">
            @if (Model.propIsActive)
            {
                <span style="color:green;">YES</span>
            }
            else
            {
                <span style="color:red;">NO</span>
            }
        </div>
    </div>
    <p style="clear:both; padding-top:3em;">
    @Html.ActionLink("Edit", "EditProperty", "Admin", new { propId = Model.propID }, null ) |
    @Html.ActionLink("Back to List", "ManageProperties", "Admin", null, null)
    </p>
    </div>
    
        </nav>
    </aside>


</div>